package com.jysz.certificate.persistence.model.cm.applyAdd;

import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.jysz.certificate.persistence.enums.applyAdd.ApplyAddType;
import com.jysz.certificate.persistence.model.cs.TheNetworkList;
import com.jysz.certificate.persistence.model.system.Shop;
import com.jysz.certificate.persistence.model.system.User;
import com.jysz.webcore.ssh.entity.AbstractBaseEntity;

@Entity
@Table(name = "cm_applycer_")
@org.hibernate.annotations.Entity
public class ApplyCer   extends AbstractBaseEntity<Long>  {

	/**
	 * 合格证批量申请单
	 */
	private static final long serialVersionUID = 1L;
	
	public User user;//申请人
	public Shop shop;//销售店
	public Date applyDate;//申请时间
	public ApplyAddType state;//申请单状态
	private List<ApplyCerList> applyCerLists ;
	
	@OneToMany(targetEntity = ApplyCerList.class, cascade = { CascadeType.ALL }, mappedBy = "applyCer")  
	public List<ApplyCerList> getApplyCerLists() {
		return applyCerLists;
	}
	public void setApplyCerLists(List<ApplyCerList> applyCerLists) {
		this.applyCerLists = applyCerLists;
	}
	@ManyToOne(fetch = FetchType.LAZY)  
	@JoinColumn(name = "_user_id",columnDefinition="bigint(20)") 
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	@ManyToOne(fetch = FetchType.LAZY)  
	@JoinColumn(name = "_shop_id",columnDefinition="bigint(20)") 
	public Shop getShop() {
		return shop;
	}
	public void setShop(Shop shop) {
		this.shop = shop;
	}
	@Column(name = "_applyDate")
	public Date getApplyDate() {
		return applyDate;
	}
	public void setApplyDate(Date applyDate) {
		this.applyDate = applyDate;
	}
	@Column(name = "_state")
	public ApplyAddType getState() {
		return state;
	}
	public void setState(ApplyAddType state) {
		this.state = state;
	}
	

}
